home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir39 / envform.zip / EX2.BAT < prev    next >
DOS Batch File  |  1994-10-17  |  1KB  |  37 lines

  1. @ECHO OFF
  2. REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
  3. REM *                                                                     *
  4. REM * ENVFORM example two                                                 *
  5. REM *                                                                     *
  6. REM * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
  7.  
  8. REM - Set defaults
  9.   SET testfile=
  10.  
  11. REM - Call ENVFORM.EXE with name of .INI file
  12.   :loop
  13.   envform ex2.ini
  14.  
  15. REM - Test for any errors or user abort
  16.   IF ERRORLEVEL 1 GOTO byebye
  17.  
  18. REM - Perform SET statements defined in .INI file
  19.   Call ex2b.bat
  20.   Erase ex2b.bat
  21.  
  22. REM - Set error and re-enter if no file entered
  23.   SET ENVError=File name to edit must be entered!
  24.   IF (%testfile%)==() GOTO LOOP
  25.  
  26. REM - Set error and re-enter if file does not exist
  27.   SET ENVError=File does not exist, please re-enter!
  28.   IF NOT EXIST %testfile% GOTO LOOP
  29.  
  30. REM - Execute a program using newly set environment variables
  31.   EDIT %testfile%
  32.  
  33. REM - Cleanup is always recommended (but seldom done)
  34.   :byebye
  35.   SET ENVError=
  36.   SET testfile=
  37.